import request from '@/utils/request'
// import { getToken } from '@/utils/auth'

export function getDockFunctionConfig(configType) {
  return request({
    url: '/wxh-cloud-rest/rest/thirdparty/manage/getFunctionConfig',
    method: 'get',
    params: { type: configType }
  })
}

export function getOpendFunction(type, bussinessId) {
  return request({
    url: '/wxh-cloud-rest/rest/thirdparty/manage/getOpenFunction',
    method: 'get',
    params: { type: type, businessId: bussinessId }
  })
}

export function getOrderPartnerCompany() {
  return request({
    url: '/wxh-cloud-rest/rest/thirdparty/manage/getSystemPartnerCompany',
    method: 'get'
  })
}

export function getDockSystem(name, useStatus) {
  var param = {
    name: name, useStatus: useStatus
  }
  return request({
    url: '/wxh-cloud-rest/rest/thirdparty/manage/system/list',
    method: 'get',
    params: param
  })
}

export function saveSystemConfig(data) {
  return request({
    url: '/wxh-cloud-rest/rest/thirdparty/manage/system/save',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  })
}

export function getDockAccount(param) {
  return request({
    url: '/wxh-cloud-rest/rest/thirdparty/manage/account/list',
    method: 'get',
    params: param
  })
}

export function saveAccount(data) {
  return request({
    url: '/wxh-cloud-rest/rest/thirdparty/manage/account/save',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  })
}
